<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get the state of the zookeeper connection</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="zookeeper.getrecvtimeout.html">« Zookeeper::getRecvTimeout</a></li>
      <li style="float: right;"><a href="zookeeper.isrecoverable.html">Zookeeper::isRecoverable »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.zookeeper.html">Zookeeper</a></li>
    <li>Get the state of the zookeeper connection</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="zookeeper.getstate" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Zookeeper::getState</h1>
  <p class="verinfo">(PECL zookeeper &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">Zookeeper::getState</span> &mdash; <span class="dc-title">Get the state of the zookeeper connection</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-zookeeper.getstate-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="methodname"><strong>Zookeeper::getState</strong></span>(): <span class="type">int</span></div>

 </div>


 <div class="refsect1 parameters" id="refsect1-zookeeper.getstate-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-zookeeper.getstate-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the state of zookeeper connection on success, and false on failure.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-zookeeper.getstate-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
   This method emits PHP error/warning when it fails to get state of zookeeper connection.
  </p>
  <div class="caution"><strong class="caution">警告</strong>
    <p class="para">
      Since version 0.3.0, this method emits <span class="classname"><a href="class.zookeeperexception.html" class="classname">ZookeeperException</a></span> and it&#039;s derivatives.
    </p>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-zookeeper.getstate-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="methodname"><a href="zookeeper.construct.html" class="methodname" rel="rdfs-seeAlso">Zookeeper::__construct()</a> - Create a handle to used communicate with zookeeper</span></li>
   <li class="member"><span class="methodname"><a href="zookeeper.connect.html" class="methodname" rel="rdfs-seeAlso">Zookeeper::connect()</a> - Create a handle to used communicate with zookeeper</span></li>
   <li class="member"><span class="methodname"><a href="zookeeper.getclientid.html" class="methodname" rel="rdfs-seeAlso">Zookeeper::getClientId()</a> - Return the client session id, only valid if the connections is currently connected (ie. last watcher state is ZOO_CONNECTED_STATE)</span></li>
   <li class="member"><a href="class.zookeeper.html#zookeeper.class.constants.states" class="link">ZooKeeper States</a></li>
   <li class="member"><span class="classname"><a href="class.zookeeperexception.html" class="classname">ZookeeperException</a></span></li>
  </ul>
 </div>


</div></div></div></body></html>